package codeRandomThoughts.剑指Offer05替换空格;

public class Solution {
    public String replaceSpace(String s) {
        StringBuilder stringBuffer = new StringBuilder();
        char[] chars = s.toCharArray();
        for (char aChar : chars) {
            if (aChar == ' ') {
                stringBuffer.append("%20");
                continue;
            }
            stringBuffer.append(aChar);
        }
        return stringBuffer.toString();
    }
}
